﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Yuchen.ExtJSDTSGenerator.UI.Models
{
    public class ExtMethod : ExtMember
    {
        public ExtMethod()
        {
            Parameters = new List<ExtParameter>();
        }
        public List<ExtParameter> Parameters { get; set; }
        public override string ToString()
        {
            var parameters = string.Join(",", Parameters.Select(x => x.ToString()));
            if (IsStatic)
            {
                return string.Format("static {0}({2}):{1}", Name, Type, parameters);
            }
            return string.Format("{0}({2}):{1}", Name, Type, parameters);
        }
    }
}
